1. Field of the Invention
The present invention relates to a computer program product, system, and method for selecting cache lists indicating tracks in a cache to process for demotion.
2. Description of the Related Art
A cache management system buffers tracks in a storage device recently accessed as a result of read and write operations in a faster access storage device, such as memory, than the storage device storing the requested tracks. Subsequent read requests to tracks in the faster access cache memory are returned at a faster rate than returning the requested tracks from the slower access storage, thus reducing read latency. The cache management system may also return complete to a write request when the modified track directed to the storage device is written to the cache memory and before the modified track is written out to the storage device, such as a hard disk drive. The write latency to the storage device is typically significantly longer than the latency to write to a cache memory. Thus, using cache also reduces write latency.
A cache management system may maintain a linked list having one entry for each track stored in the cache, which may comprise write data buffered in cache before writing to the storage device or read data. In the commonly used Least Recently Used (LRU) cache technique, if a track in the cache is accessed, i.e., a cache “hit”, then the entry in the LRU list for the accessed track is moved to a Most Recently Used (MRU) end of the list. If the requested track is not in the cache, i.e., a cache miss, then the track in the cache whose entry is at the LRU end of the list may be removed and demoted and an entry for the track data staged into cache from the storage is added to the MRU end of the LRU list. With this LRU cache technique, tracks that are more frequently accessed are likely to remain in cache, while data less frequently accessed will more likely be removed from the LRU end of the list to make room in cache for newly accessed tracks.
When processes access a track in the cache, a track identifier of the accessed cache needs to be moved to the MRU end of the LRU list. To move a track identifier to the MRU end, a lock needs to be obtained on the LRU list. If multiple processes are trying to access the cache, then contention for the LRU list lock among the multiple processes may delay cache processing. One technique for addressing LRU list lock contention is to provide multiple LRU lists to indicate cached tracks, so that now different processors can simultaneously access the different LRU lists to process tracks in the LRU lists.
Of the multiple LRU lists, an Active LRU list may be provided for random non-Solid State Drive (SSD) tracks, a Fast LRU list may be provided for random SSD tracks, an accelerated LRU list may be provided for sequential tracks, and a demote ready LRU list may be provided for unmodified tracks that are ready to be demoted.
When cache is full, tracks need to be demoted to make room for newly accessed tracks. The LRU lists are scanned to determine unmodified tracks to move to the demote ready LRU list so they may be demoted.
There is a need in the art for improved techniques for selecting tracks for demotion from the cache.